#!/usr/bin/env python
# -*- coding:utf-8 -*-
import contextlib

@contextlib.contextmanager  #这个装饰器和with配合，完成上下文切换。
def show():
    print 'before'
    yield
    print 'after'

with show():
    print 'with in'